package com.guigu.qingcheng.service_user.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.guigu.qingcheng.pojo.user.TbUser;
import com.guigu.qingcheng.utils.R;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * <p>
 * 用户表 服务类
 * </p>
 *
 * @author testjava
 * @since 2020-07-08
 */
public interface TbUserService extends IService<TbUser> {
    //按条件查询分页
    Page<TbUser> findPage(@RequestBody Map<String,Object> searchMap, @RequestParam("page") Integer page, @RequestParam("size") Integer size);

    /**
     * 发送短信验证码
     * @param mobile
     */
    public void sendSms(String mobile);

    /**
     * 增加
     * @param tbUser
     * @param smsCode
     */
    public R add(TbUser tbUser, String smsCode);

    /**
     * 登录方法
     * @param user
     * @return
     */
    String login(TbUser user);


    /**
     * 根据openid判断
     * @param openid
     * @return
     */
    TbUser getByOpenid(String openid);
}
